#ifndef BASE_SYSTEM_LOG_IO_INCLUDE_IO_CONSOLE_OUTPUT_STRATEGY_H
#define BASE_SYSTEM_LOG_IO_INCLUDE_IO_CONSOLE_OUTPUT_STRATEGY_H

#include <mutex>
#include "i_output_strategy.h"

namespace Base {
namespace SystemLog {
class ConsoleOutputStrategy : public IOutputStrategy {
public:
    ConsoleOutputStrategy(bool useStderr = false);
    ErrCode Write(const char* data, size_t len) override;
    ErrCode Flush() override;
    ErrCode Close() override;
    std::string GetName() const override;

private:
    int fd_;
    std::mutex mutex_;
};
} // namespace SystemLog
} // namespace Base

#endif // BASE_SYSTEM_LOG_IO_INCLUDE_IO_CONSOLE_OUTPUT_STRATEGY_H